﻿//
// Created by Administrator on 2020/9/15.
//
#include <iostream>

class Test {
public:
    inline virtual void test() {
        std::cout << "Test" << std::endl;
    }
};

class SubTest : public Test {
public:
    inline void subTest() {
        std::cout << "SubTest" << std::endl;
    }

    inline virtual void test() {
        std::cout << "Test" << std::endl;
    }
};

int main() {

    std::cout << typeid(Test).name() << std::endl;
//    std::cout << typeid(Test).raw_name() << std::endl;

    Test *test = new SubTest;

    SubTest *subTest = dynamic_cast<SubTest *>(test);
    if (subTest) {
        subTest->subTest();
        subTest->test();
    }

    return 0;
}
